package com.cssy.yd.basic.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.yd.basic.dao.BasicCurrencyDAO;
import com.cssy.yd.basic.entity.BasicCurrencyDO;
import com.cssy.yd.basic.service.IBasicCurrencyService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.IDCodeTypeUtil;


@Service("basicCurrencyService")
public class BasicCurrencyServiceImpl implements IBasicCurrencyService{

	
	@Resource(name="basicCurrencyDAO")	
	private BasicCurrencyDAO basicCurrencyDAO;
	
	
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs=new SearchResult(scs);
		List<BasicCurrencyDO>  list=basicCurrencyDAO.find(scs);
		rs.setRecordCount(basicCurrencyDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		basicCurrencyDAO.deleteBasicCurrencyDOByPrimaryKey(id);
		return null;
	}

	@Override
	public Integer update(BasicCurrencyDO t, User user) throws SyBaseException {
		t.setDuuser(user.getName());
		t.setDutime(new Date());
		return basicCurrencyDAO.updateBasicCurrencyDO(t);
	}

	@Override
	public BasicCurrencyDO save(BasicCurrencyDO t, User user)
			throws SyBaseException {
		t.setId(IDCodeTypeUtil.getId());
		t.setDcruser(user.getName());
		t.setDctime(new Date());
		basicCurrencyDAO.insertBasicCurrencyDO(t);
		return t;
	}

	@Override
	public BasicCurrencyDO findListById(String id) throws SyBaseException {
		
		return basicCurrencyDAO.findBasicCurrencyDOByPrimaryKey(id);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

}
